package main

import (
	"strconv"
	"strings"
)

func main() {

}

// minute hour day month week

type CronTime struct {
	minute     []int
	minuteStep int
	hour       []int
	hourStep   int
	day        []int
	dayStep    int
	month      []int
	monthStep  int
	week       []int
	weekStep   int
}

func NewCronTime(expression string) *CronTime {
	fields := strings.Fields(expression)
	cronTime := new(CronTime)
	cronTime.minute, cronTime.minuteStep = getOptions(fields[0])
}

func cronTimerGenerator(expression string, targetTime string) []string {
	cronTime := NewCronTime(expression)
}

func getOptions(str string) ([]int, int) {
	var ans []int
	var step int
	if str == "*" {
		return nil, 0
	}
	hashSplits := strings.Split(str, "/")
	if len(hashSplits) == 2 {
		step, _ = strconv.Atoi(hashSplits[1])
	}
	has := strings.Contains(str, ",")
	if has {
		splits := strings.Split(str, ",")
		for i := 0; i < len(splits); i++ {
			n, _ := strconv.Atoi(splits[i])
			ans = append(ans, n)
		}
		return ans, step
	}
	return ans, step
}
